Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Some observations:
- With these changes there's currently no way to "Cancel All" bookings.
- Since we only display the "Next upcoming recurring booking", we need to cancel it, refresh, cancel the next one, refresh, cancel.... etc.
- It is unexpected that the individual bookings aren't appearing in "Upcoming"
So my two cents would be:
- "Upcoming" should display ALL upcoming events regardless of type (recurring, single, paid, etc.)
- Recurring should display all grouped recurring booking and maybe how many recurrences has left (ex: 5 repeats left...)
|
@zomars I agree with your your two cents above. I will update the designs accordingly. With regards to "Cancelling All" the idea was to have it so that you could do This & all following like in calendar apps but if we use the recurring events tabs to show them grouped we can probably have a cancel all remaining anyway. |
| import { useLocale } from "@calcom/lib/hooks/useLocale"; | ||
| import showToast from "@calcom/lib/notification"; | ||
| import { Frequency } from "@calcom/prisma/zod-utils"; | ||
| import { getEveryFreqFor } from "@calcom/lib/recurringStrings"; |
There was a problem hiding this comment.
A repeated string for recurring events was refactored into its own util
| * the "Recurring" tab, to support confirming discretionally in the "Recurring" tab. | ||
| */ | ||
| if (booking.listingStatus === "upcoming" && booking.recurringEventId !== null) { | ||
| if (booking.listingStatus === "recurring" && booking.recurringEventId !== null) { |
There was a problem hiding this comment.
this is now a behavior desired for the recurring tab, not upcoming
| ]; | ||
|
|
||
| if (booking.listingStatus === "recurring" && booking.recurringEventId !== null) { | ||
| bookedActions = bookedActions.filter((action) => action.id !== "edit_booking"); |
There was a problem hiding this comment.
In case we are dealing with a recurring booking, no edition available
| if (booking.status === BookingStatus.PENDING) { | ||
| // Only take into consideration next up instances if booking is confirmed | ||
| recurringDates = recurringDates.filter((aDate) => aDate >= today); | ||
| recurringStrings = recurringDates.map((_, key) => recurringStrings[key]); |
There was a problem hiding this comment.
This is to support the "X remaining events" copy in confirmed recurring events showing in the recurring tab
| {booking.recurringCount && | ||
| booking.eventType?.recurringEvent?.freq && | ||
| booking.listingStatus === "upcoming" && ( | ||
| (booking.listingStatus === "recurring" || booking.listingStatus === "cancelled") && ( |
There was a problem hiding this comment.
We want to show recurring information both in recurring and cancelled tabs
|
|
||
| const shownBookings: Record<string, boolean> = {}; | ||
| const filterBookings = (booking: BookingOutput) => { | ||
| if (status === "recurring" || status === "cancelled") { |
There was a problem hiding this comment.
We want to group recurring event instances into just one for cancelled and recurring tabs
| id: "reject", | ||
| label: | ||
| booking.listingStatus === "upcoming" && booking.recurringEventId !== null | ||
| booking.listingStatus === "recurring" && booking.recurringEventId !== null |
There was a problem hiding this comment.
Let's extract this repeated condition to isRecurring and use it instead
|
Sorry @zomars, saw your approval and jump right into merging, it's been a long-lasting PR 😅 Will tackle refactoring that repetitive condition in a separate PR. Would it be cool to add that check in |
It's ok for now |

What does this PR do?
Thanks @hariombalhara for your feedback. Here are the points you mentioned to check one by one.
Type of change
How should this be tested?
UpcomingorRecurringdepending on confirmation status. Rejecting a whole series fromUpcoming.